// extends与implements的不同
/**
 *   extends 是继承某个类, 继承之后可以使用父类的方法, 也可以重写父类的方法; 

     implements 是实现多个接口, 接口的方法一般为空的, 必须重写才能使用 
 */
class Student{
    fullName:string;
    constructor(public firstName, public middleInitial , public lastName){
        this.fullName = firstName + " " + middleInitial + " " + lastName;
    }
}

interface Person {
    firstName: string;
    lastName: string;
}

function greeter(person : Person) {
    return "Hello, " + person.firstName + " " + person.lastName;
}

let user = new Student("Jane", "M.", "User");

document.body.innerHTML = greeter(user);